package com.eco.fanliapp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eco.fanliapp.dao.SyDoubletwelveUserMapper;
import com.eco.fanliapp.entity.SyDoubletwelveUser;
import com.eco.fanliapp.service.ISyDoubletwelveUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-12-06
 */
@Service
public class SyDoubletwelveUserServiceImpl extends ServiceImpl<SyDoubletwelveUserMapper, SyDoubletwelveUser> implements ISyDoubletwelveUserService {

    @Autowired
    private SyDoubletwelveUserMapper syDoubletwelveUserMapper;

    @Override
    public int insertDoubletweleve(Long userId) {
        SyDoubletwelveUser syDoubletwelveUser = new SyDoubletwelveUser();
        syDoubletwelveUser.setUserId(userId);
        syDoubletwelveUser.setHasParticipate(1);
        return syDoubletwelveUserMapper.insertDoubletweleve(syDoubletwelveUser);
    }

    @Override
    public Integer isParticipate(Long userId) {
        return syDoubletwelveUserMapper.isParticipate(userId);
    }
}
